#include<iostream>
using namespace std;



int main() {
	int y, m, d;
	cin >> y >> m >> d;
	if (y == 2015 && m == 2 && d == 29)
	{
		cout << "Invalid day!" << endl;
		
		d = 1;
	}
	//Date dt(y, m, d);
	cout << y << "-" << m << "-" << d << endl;
	return 0;
}